// 引入 request 方法，假设 request 方法已经定义在某个工具文件中
import request from '/@/utils/request';
// 定义 API 路径枚举
enum Api {
    SysDictTypePage = '/SysDictTyp/pages',
    SysDictTypeAdd = '/SysDictTyp/addData',
    SysDictTypeUpdate = '/SysDictTyp/UpdateData',
    SysDictTypeDelete = '/SysDictTyp/deleteData',
    SysDictTypeAllDictList = '/SysDictTyp/allDictList',
    SysDictTypeDataList = '/SysDictTyp/dataList',
    SysDictTypeDetail = '/SysDictTyp/detail',
    SysDictTypeList = '/SysDictTyp/list',
    SysDictTypeSetStatus = '/SysDictTyp/setStatus',
}

// 添加字典类型
export const apiSysDictTypeAddPost = (body: any) =>
    request({
        url: Api.SysDictTypeAdd,
        method: 'post',
        data: body,
    });

// 获取所有字典集合
export const apiSysDictTypeAllDictListGet = () =>
    request({
        url: Api.SysDictTypeAllDictList,
        method: 'get',
    });

// 获取字典类型-值列表
export const apiSysDictTypeDataListGet = (code: string) =>
    request({
        url: Api.SysDictTypeDataList,
        method: 'get',
        params: { Code: code },
    });

// 删除字典类型
export const apiSysDictTypeDeletePost = (body: any) =>
    request({
        url: Api.SysDictTypeDelete,
        method: 'post',
        data: body,
    });

// 获取字典类型详情
export const apiSysDictTypeDetailGet = (id: number, status?: any) =>
    request({
        url: Api.SysDictTypeDetail,
        method: 'get',
        params: { Id: id, Status: status },
    });

// 获取字典类型列表
export const apiSysDictTypeListGet = () =>
    request({
        url: Api.SysDictTypeList,
        method: 'get',
    });

// 获取字典类型分页列表
export const apiSysDictTypePagePost = (body: any) =>
    request({
        url: Api.SysDictTypePage,
        method: 'get',
        data: body,
    });

// 修改字典类型状态
export const apiSysDictTypeSetStatusPost = (body: any) =>
    request({
        url: Api.SysDictTypeSetStatus,
        method: 'post',
        data: body,
    });

// 更新字典类型
export const apiSysDictTypeUpdatePost = (body: any) =>
    request({
        url: Api.SysDictTypeUpdate,
        method: 'put',
        data: body,
    });